home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
EARCD
/
comm
/
mail
/
Spam_O_Matic.lha
/
Spam-O-Matic.thor
< prev
next >
Wrap
Text File
|
1996-12-02
|
3KB
|
129 lines
/* $VER: SOM.thor 1.1 (01.12.96)
*
* Saves the current message in Thor, and forwards the message
* to several "interested" parties.
*
* PLEASE don't use this as a toy!
* The only way our concerns will be taken seriously is if WE
* take them seriously.
*
* Concept & Original Script by: Kirk Strauser <kstrauser@gxl.com>
* Re-written by: Adrian Knight <ajk@dial.pipex.com>
* and: Kirk Strauser
*/
options results
options failat 31
thorport = address()
if left(thorport, 5) ~= 'THOR.' then do
say 'Cannot find thorport.'
exit
end
if ~show('p', 'BBSREAD') then do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
address(thorport)
CURRENTMSG stem MSG
if (rc ~= 0) then call disreq("No current message.")
SAVEMESSAGE CURRENT FILE "T:Spam.temp1"
if(rc ~= 0) then call disreq("Unable to save current message.")
/* Choose between Thor and YAM mailers */
REQUESTNOTIFY TEXT '"Which mailer do you want to use to send these messages?"' BT '"_THOR|_YAM"'
if (rc ~= 0) then call disreq("No valid mailer selected.")
poster=result
if poster=1 then do
REQUESTNOTIFY TEXT '"Mark message as urgent?"' BT '"_Yes|_No"'
if (rc ~= 0) then call disreq
flag = result
end
address BBSREAD
READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR headstem HEADTAGS textstem TEXTTAGS
if (rc ~= 0) then call disreq
UNIQUEMSGFILE bbsname '"'MSG.BBSNAME'"' stem tmp
if (rc ~= 0) then call disreq
/* Get the domain in a seperate variable */
parse var HEADTAGS.FROMADDR j"@"domain
if domain='' then call disreq("Unable to find senders domain name")
/* Build the outgoing message */
address command 'Join THOR:rexx/SpamHeader T:Spam.temp1 THOR:rexx/SpamFooter as 'tmp.NAME
if (rc ~= 0) then call disreq("Unable to build message file.")
/* Use the appropriate mailer to send it */
if (poster = 1) then call WriteThorMessage
else call WriteYamMessage
if (rc ~= 0) then call disreq
call cleanup
WriteThorMessage:
address BBSREAD
EVE_ENTERMSG = 0
drop EVENT.
EVENT.TONAME = HEADTAGS.FROMNAME || ',Postmaster,Bureau of Consumer Services,National Fraud Information Center'
EVENT.TOADDR = HEADTAGS.FROMADDR || ',postmaster@' || domain || ',bbroder@ftc.gov,nfic@internetmci.com'
EVENT.SUBJECT = 'Usenet spam/mail fraud'
EVENT.CONFERENCE = 'EMail'
EVENT.MSGFILE = tmp.NAME
EVENT.URGENT = flag
WRITEBREVENT bbsname '"'MSG.BBSNAME'"' event EVE_ENTERMSG stem EVENT
return
WriteYamMessage:
yap=1
if ~show('p','YAM') then do
address command
'Run <>NIL: YAM:YAM'
'WaitForPort "YAM"'
yap=0
end
if ~show('p','YAM') then call disreq("Unable to load YAM.")
address 'YAM'
MAILWRITE
/* This line MUST be punctuated exactly like this! */
'WRITESUBJECT "Usenet spam/mail fraud"'
WRITEMAILTO HEADTAGS.FROMADDR || ',postmaster@' || domain || ',bbroder@ftc.gov,nfic@internetmci.com'
WRITELETTER tmp.NAME
'REQUEST "Should this be sent or queued?" "Send|Queue"'
if (result = 0) then writequeue
else writesend
/* Kill YAM if we started it */
if ~yap then 'QUIT'
return
disreq:
PARSE ARG distext
if distext = '' then do
if address() = "BBSREAD" then distext=BBSREAD.LASTERROR
else distext=THOR.LASTERROR
end
address(thorport)
REQUESTNOTIFY TEXT '"' distext '"' BT '"_Abort"'
call cleanup
return
cleanup:
address command 'delete >nil: T:Spam.temp?'
exit